import React from 'react';
import Link from 'umi/link';
import styles from './index.less';

export default props => {
  const { title, more, moreContent, link, linkContent, action, fontColor } = props;
  return (
    <div className={styles.titleBox}>
      <span className={styles.titleIcon} />
      <span className={styles.title} style={fontColor ? { color: fontColor } : {}}>
        {title || ''}
      </span>
      {more && (
        <span className={styles.more} onClick={more}>
          {moreContent || '更多'}
        </span>
      )}
      {link && (
        <Link className={styles.more} to={link}>
          {linkContent || '更多'}
        </Link>
      )}
      {action && <span className={styles.more}>{action}</span>}
    </div>
  );
};
